import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

int parseInt(dynamic from, {Color? defaultColor}) {
  try {
    var result = int.parse("$from");
    return result;
  } catch (e) {}
  return defaultColor == null ? 0 : defaultColor.value;
}

double parseDouble(dynamic from) {
  try {
    var result = double.parse("$from");
    return result;
  } catch (e) {}
  return 0;
}
